package com.uzai.console.web.wechatwork;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.wechatwork.wxq.wxgorupblacklist.blacklistpub.WxqWorkBlacklistPubIdDto;
import com.uzai.console.dto.wechatwork.wxq.wxgorupblacklist.blacklistpub.WxqWorkBlacklistPubQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.wechatwork.WxqWorkBlacklistPubService;
import com.uzai.console.vo.wechatwork.wxq.wxgroupblacklist.blacklistpub.WxqWorkBlacklistPubVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 社群全网黑名单
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "社群全网黑名单",tags = "企业微信|社群黑名单|社群全网黑名单")
@ApiSort(6)
@RestController
public class WxqWorkBlacklistPubController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(WxqWorkBlacklistPubController.class);

    @Autowired
    private WxqWorkBlacklistPubService wxqWorkBlacklistPubService;

    @ApiOperation(value = "分页查询企业微信社群全网黑名单列表", notes = "分页查询社群全网黑名单列表", response = WxqWorkBlacklistPubVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/wxqWorkBlacklistPub/findWxqWorkBlacklistPubList")
    public Object findWxqWorkBlacklistPubList(@RequestBody WxqWorkBlacklistPubQuery wxqWorkBlacklistPubQuery){
        return wxqWorkBlacklistPubService.findWxqWorkBlacklistPubList(wxqWorkBlacklistPubQuery);
    }

    @SystemLogType(model = SystemModelEnum.WxqWorkBlacklistPub, type = OperationTypeEnum.ADD)
    @ApiOperation(value = "加入企业微信社群白名单", notes = "加入社群白名单")
    @ApiOperationSupport(order = 2)
    @PostMapping("/wxqWorkBlacklistPub/addWxqWorkBlacklistPubWhite")
    public Object addWxqWorkBlacklistPubWhite(@RequestBody WxqWorkBlacklistPubIdDto wxqWorkBlacklistPubIdDto){
        wxqWorkBlacklistPubService.addWxqWorkBlacklistPubWhite(wxqWorkBlacklistPubIdDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.WxqWorkBlacklistPub, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "取消企业微信社群白名单", notes = "取消社群白名单")
    @ApiOperationSupport(order = 3)
    @PostMapping("/wxqWorkBlacklistPub/deleteWxqWorkBlacklistPubWhite")
    public Object deleteWxqWorkBlacklistPubWhite(@RequestBody WxqWorkBlacklistPubIdDto wxqWorkBlacklistPubIdDto){
        wxqWorkBlacklistPubService.deleteWxqWorkBlacklistPubWhite(wxqWorkBlacklistPubIdDto);
        return true;
    }
}
